package com.runshu.newsmartark.dbutil;

import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

import java.util.ArrayList;
import java.util.Objects;


/**
 * Demo class
 *
 * @author yu
 * @date 12/11/20
 * @decs：全部商品的数据
 */
// entity声明定义，并且指定了映射数据表明
@Entity(tableName = "MenTmpTableEntity")
public class MenTmpTableEntity {
    @NonNull
    @PrimaryKey
    private String serialNo;



    public String getSerialNo() {
        return serialNo == null ? "" : serialNo;
    }

    public void setSerialNo(String serialNo) {
        this.serialNo = serialNo == null ? "" : serialNo;
    }

public static ArrayList<MenTmpTableEntity> generateList(String... serno){

    ArrayList<MenTmpTableEntity> objects = new ArrayList<>();
        for(String tmp:serno){
        MenTmpTableEntity menTmpTableEntity = new MenTmpTableEntity();
        menTmpTableEntity.setSerialNo(tmp);
        objects.add(menTmpTableEntity);}
        return objects;
}

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof MenTmpTableEntity)) return false;
        MenTmpTableEntity that = (MenTmpTableEntity) o;
        return getSerialNo().equals(that.getSerialNo());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getSerialNo());
    }
}